Carbon


SndDoCommand

Header: Sound.h Carbon status: Supported

Queues a command in a sound channel.

OSErr SndDoCommand (
    SndChannelPtr chan, 
    const SndCommand *cmd, 
    Boolean noWait
);
Parameter descriptions
chan

A pointer to a valid sound channel.

cmd

A sound command to be sent to the channel specified in the chan parameter. See “Sound Command Numbers A”.

noWait

A flag indicating whether the Sound Manager should wait for a free space in a full queue or whether it should return immediately with a queueFull result code if the queue is full . The noWait parameter has meaning only if a sound channel’s queue of sound commands is full. If the noWait parameter is set to FALSE and the queue is full, the Sound Manager waits until there is space to add the command, thus preventing your application from doing other processing. If noWait is set to TRUE and the queue is full, the Sound Manager does not send the command and returns the queueFull result code.

function result

A result code.

DISCUSSION

The SndDoCommand function sends the sound command specified in the cmd parameter to the end of the command queue of the channel specified in the chan parameter.

Whether SndDoCommand moves memory depends on the particular sound command you’re sending it. Most of the available sound commands do not cause SndDoCommand to move memory and can therefore be issued at interrupt time. Moreover, you can sometimes safely send commands at interrupt time that would otherwise cause memory to move if you’ve previously issued the soundCmd sound command to preconfigure the channel at noninterrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)